package com.gxa.hualian.service.Impl;

import com.gxa.hualian.dao.UsersDao;
import com.gxa.hualian.mapper.UsersMapper;
import com.gxa.hualian.pojo.Users;
import com.gxa.hualian.service.UserService;
import com.gxa.hualian.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

//value值表示bean的id
@Component
public class UserServiceImpl implements UserService {
    @Autowired
    private UsersDao usersDao = null;
    @Autowired
    private UsersMapper usersMapper=null;
    @Autowired
    public void setUsersDao(UsersDao usersDao) {
        this.usersDao = usersDao;
    }

    @Override
    public void add() {
       // int t=1/0;
         usersDao.add();
    }

    @Override
    public List<Users> selectAll(String para, Integer page, Integer size) {
        return usersMapper.selectAll(para, (page-1)*size, size);
    }

    @Override
    public int insertUser(Users users) {
       return usersMapper.insertUser(users);
    }

}
